package com.byedu.domain.course.vo;

import com.byedu.domain.course.UserDO;

import java.io.Serializable;
import java.util.List;

public class UserVO implements Serializable {

	private static final long serialVersionUID = -4419689144411223890L;

    /*用户编号*/
    private String id;
    /*用户名*/
    private String username;
    /*密码*/
    private String password;
    /*昵称*/
    private String nickname;
    /*头像*/
    private String avatar;

    private List<CourseVO> courseVOList;

    public UserVO () {}

    public UserVO (UserDO userDO, List<CourseVO> courseVOList) {
        this.id = userDO.getId();
        this.username = userDO.getUsername();
        this.password = userDO.getPassword();
        this.nickname = userDO.getNickname();
        this.avatar = userDO.getAvatar();
        this.courseVOList = courseVOList;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserVO userVO = (UserVO) o;

        if (id != null ? !id.equals(userVO.id) : userVO.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "UserVO{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", avatar='" + avatar + '\'' +
                ", courseVOList='" + courseVOList + '\'' +
                '}';
    }
}
